<?php 
/**
*file artrecyle.php
* 文章回收站 显示已回收的数据
*
*/
define('ACC', true);
require('../include/init.php');
//用户检查
if (empty($_SESSION['username'])) {
	header("location:../index.php");
}

$art = new ArtModel();

$page = isset($_GET['page'])?$_GET['page']+0:1;  //当前页
$total = $art->artTotal_No();     //回收站文章的总条数
$pagenumber = 16;                 //每页条数
$offset = ($page-1)*$pagenumber;  //偏移量

//查询所有已回收的数据 分页加入$offset,$pagenumber
$artlist = $art->artrecycle($offset,$pagenumber);
//分页
$pag = new PageTool($total,$page,$pagenumber);
$pagcode = $pag->paging();
//print_r($pagcode);

//移动
if (empty($_GET['art_id'])) {
	include(ROOT.'/view/admin/artreycle.html');
}else {
    $art_id = $_GET['art_id']+0;

	if (!$art->moveRecycle($art_id)) {
	$info = '移动到回收站失败';
	include(ROOT.'view/admin/info.html');
	exit;
}else {
	$info = '移动到回收站成功';
	include(ROOT.'view/admin/info.html');
}



}






?>